<template>
	<view class="container">
		<view v-show="!weburl">{{message}}</view>
        <web-view :src="weburl" @onPostMessage="handlePostMessage" v-show="weburl"></web-view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				weburl:'',
				message:''
				
			};
		},
		onLoad() {
			this.weburl=`https://naming.xinln.com/mp3/pdf/pdf.html?/ai/digitallibrary/bookExposure/lengleng/Book/0～18个月宝宝精心照顾/0～18个月宝宝精心照顾.pdf`
		},
		methods:{
          open(){
			uni.downloadFile({
  url: 'https://example.com/somefile.pdf',
  success: function (res) {
    var filePath = res.tempFilePath;
    uni.openDocument({
      filePath: filePath,
      showMenu: true,
      success: function (res) {
        console.log('打开文档成功');
      }
    });
  }
});  
		  },
			handlePostMessage(e) {
				let data = e.detail.data;
				console.log(JSON.stringify(data));
			}
		}
	}
</script>
<style lang="scss" scoped>
.btn_submit{
	position: fixed;
	left: 50%;
	bottom: 20rpx;
	margin-left: -120rpx;
	width: 240rpx;
	height: 240rpx;
}
</style>